Skip to content

Comments

Enable namespace filtering for trivy metrics#1199

Merged
jakub-racek-swi merged 5 commits intomasterfrom
Fix-filters-for-trivy-data
Nov 26, 2025
Merged

Enable namespace filtering for trivy metrics#1199
jakub-racek-swi merged 5 commits intomasterfrom
Fix-filters-for-trivy-data

Conversation

@jakub-racek-swi
Copy link
Contributor

  • moved namespace attribute from datapoint to resource (was unused until this point)
  • added namespace filter to trivy metric pipeline

@github-actions github-actions bot added the helm label Nov 19, 2025
@jakub-racek-swi jakub-racek-swi marked this pull request as ready for review November 19, 2025 14:10
@jakub-racek-swi jakub-racek-swi requested a review from a team as a code owner November 19, 2025 14:10
@juraj-paska juraj-paska assigned murad-sw and mpecenka and unassigned murad-sw Nov 20, 2025
- set(resource.attributes["k8s.cluster.name"], "${CLUSTER_NAME}")

- set(datapoint.attributes["k8s.namespace.name"], datapoint.attributes["namespace"])
- set(resource.attributes["k8s.namespace.name"], datapoint.attributes["namespace"])
Copy link
Contributor

@mpecenka mpecenka Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, this could malform data in case there will be multiple datapoints with different namespaces.
You do not need this at all, just move the filter/namespace after groupbyattrs/trivy-operator-metrics.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea that works

@jakub-racek-swi jakub-racek-swi merged commit e12d967 into master Nov 26, 2025
35 of 38 checks passed
@jakub-racek-swi jakub-racek-swi deleted the Fix-filters-for-trivy-data branch November 26, 2025 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants